#ifndef OBJECT_H_GGJ
#define OBJECT_H_GGJ

#include "../Utils/DataUtils.h"
#include "../Defines.h"
#include <sfml/Graphics.hpp>

typedef sf::Vector2f v2f;

class CCharacter;

class CObject
{
public:
	CObject(ObjectType::Enum type);
	virtual ~CObject();

	void Render(sf::RenderWindow* win);

	bool CollidesWithCharacter(CCharacter* character) const;

	float GetAngle() const;
	const v2f& GetPosition() const;
	ObjectType::Enum GetObjectType() const;
	const sf::Sprite& GetSprite() const;
	const sf::FloatRect& GetCollisionRect(const sf::FloatRect& rect) const;
	ObjectLayer::Enum GetObjectLayer() const;

	void SetObjectLayer(ObjectLayer::Enum layer);
	void SetAngle(float angle);
	void SetPosition(const v2f& position);
	void SetCollisionRect(const sf::FloatRect& rect);
protected:
	float m_fAngle;
	v2f m_vPosition;
	sf::Sprite m_tSprite;
	sf::Texture m_tTexture;
	sf::FloatRect m_tCollisionRect;
private:
	virtual void DoRender(sf::RenderWindow* win) = 0;
	virtual bool DoCollidesWithCharacter(CCharacter* character) const = 0;

	ObjectLayer::Enum m_eObjectLayer;
	ObjectType::Enum m_eObjectType;
};

#endif // OBJECT_H_GGJ